/*************************************************************************
 *                                                                       *
 * This file is part of the FreeMAPs distribution.  For full copyright   *
 * information, see COPYRIGHT and COPYING.LESSER.                        *
 *                                                                       *
 * Author:        sqbang                                                 *
 * Email:         sqbang@ustc.edu                                        *
 * Date:          2016.08.24                                             *
 *                                                                       *
 *************************************************************************/

#ifndef FreeMAPs_include_COMMON_equa_PhaseChangeGroup_h
#define FreeMAPs_include_COMMON_equa_PhaseChangeGroup_h

#include "FreeMAPsConfig.h"

//C++ headers
#include <vector>

//COMMON headers
#include "COMMON/base/StateIndicator.h"

namespace FreeMAPs
{

//forward declaration
class PhaseChangeStrategy;
class EquationDomain;

/**
 * @brief PhaseChangeGroup used the describe the phase change in simulation.
 *
 * the main work is to describe the phase change latent and
 * the change of the mesh if necessary.
 */
class PhaseChangeGroup : public StateIndicator
{
public:

    PhaseChangeGroup(
        const EquationDomain* eq_domain);

    virtual
    ~PhaseChangeGroup();

public:

    void
    clear();

    void
    get_from_input (
        const InputDatabase* db);

    friend std::ostream&
    operator << (
        std::ostream& os,
        const PhaseChangeGroup& rhs);

private:

    typedef StateIndicator Parent;

    /*
     * the equation domain that this phase changes act on.
     */
    const EquationDomain* d_equa_domain;

    /*
     * map<item_name, item*>
     */
    std::map<std::string, PhaseChangeStrategy*> d_phase_change_items;

private:

    DISALLOW_COPY_AND_ASSIGN (PhaseChangeGroup);
};

}

#include "COMMON/equa/PhaseChangeGroup.inl"

#endif
